/**
 * UVa 369 Combinations (Recursion)
 * Author: chchwy
 * Last Modified: 2008.09.17
 */
//recursive edition
//formula: C(n,r) = C(n-1,r-1) + C(n-1,r);

#include<iostream>
using namespace std;

long C(int n, int r){
    //terminal condition
    if(n<r){ //C(3,5)=0
        return 0;
    }else if(n==r){  //C(3,3)=1
        return 1;
    }else if(n>1 && r==1){ //C(5,1)=5
        return n;
    }
    long temp = C(n-1,r-1) + C(n-1,r);
    return temp;
}

int main(){
    while(scanf("%d %d",&n,&r)==2;){
        if(n==0 && r==0) break;
        printf("%d things taken %d at a time is %d exactly.\n",n,r,C(n,r));
    }
    return 0;
}
